<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改会员')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-members-edit" th:object="${mallMembers}">
        <input name="membersId" th:field="*{membersId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">手机号：</label>
            <div class="col-sm-8">
                <input name="phone" th:field="*{phone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">密码：</label>
            <div class="col-sm-8">
                <input name="password" class="form-control" type="text">
            </div>
        </div>
        <!--<div class="form-group">    -->
        <!--<label class="col-sm-3 control-label">交易密码：</label>-->
        <!--<div class="col-sm-8">-->
        <!--<input name="tradePassword" th:field="*{tradePassword}" class="form-control" type="text">-->
        <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{sex}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b">
                    <option th:text="停用" th:value="0" th:selected="selected" th:if="*{sex} eq '0'"
                    ></option>
                    <option th:text="正常" th:value="1" th:selected="selected" th:if="*{sex} eq '1'"
                    ></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">级别Id：</label>
            <div class="col-sm-8">
                <select name="levelId" class="form-control m-b">
                    <option th:each="dict : ${mallLevels}" th:text="${dict.levelName}" th:value="${dict.levelId}"
                            th:field="*{levelId}"></option>
                </select>
                <!--<input name="levelId" th:field="*{levelId}" class="form-control" type="text">-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">生日：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="birthDate" th:value="*{birthDate}" class="form-control" placeholder="yyyy-MM-dd"
                           type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">昵称：</label>
            <div class="col-sm-8">
                <input name="nickName" th:field="*{nickName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">现金余额：</label>
            <div class="col-sm-8">
                <input name="money" th:field="*{money}" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">积分：</label>
            <div class="col-sm-8">
                <input name="integral" th:field="*{integral}" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">卡卷数：</label>
            <div class="col-sm-8">
                <input name="cardRolls" th:field="*{cardRolls}" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">礼品卡数：</label>
            <div class="col-sm-8">
                <input name="giftCards" th:field="*{giftCards}" class="form-control" type="number">
            </div>
        </div>
        <!--<div class="form-group">    -->
        <!--<label class="col-sm-3 control-label">头像：</label>-->
        <!--<div class="col-sm-8">-->
        <!--<input name="icon" th:field="*{icon}" class="form-control" type="text">-->
        <!--</div>-->
        <!--</div>-->
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "mall/members";
    $("#form-members-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-members-edit').serialize());
        }
    }

    $("input[name='birthDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>